package com.jcl.recruit.core.constants;

public class Constants {

    /* *
     * @Author yyliu
     * @Description 套餐-通用信息
     * @Date 9:37 2018/9/17
     **/
    public class MealPackage{

        // 试用版
        public static final String default_package              = "trial";

        public static final int default_day                     = 30;
    }

    public static class UserAccessInfo{

        // 试用者
        public static final int USER_TYPE_TRY                   = 0;
        // 正常
        public static final int USER_TYPE_NORMAL                = 1;
    }
    /* *
     * @Author yyliu
     * @Description 用户通用信息字段
     * @Date 9:37 2018/9/17
     **/
    public static class UserInfo{

        // 正常
        public static final int USER_STATUS_ACTIVE              = 0;
        // 失效
        public static final int USER_STATUS_INVALID             = 1;
        // 失效(未激活)
        public static final int USER_STATUS_UNACTIVE            = 2;
        // 锁定
        public static final int USER_STATUS_LOCK                = 3;

        public static final String SPLIT                        = ",";

        public static final int USER_ROLE_ADMIN                 = 0;

        public static final int USER_ROLE_HR                    = 1;

        public static String createAdminRole(){

            return SPLIT + USER_ROLE_ADMIN + SPLIT;
        }

        public static String createHrRole(){

            return SPLIT + USER_ROLE_HR + SPLIT;
        }

        public static String createAdminAndHrRole(){

            return SPLIT + USER_ROLE_ADMIN + SPLIT + USER_ROLE_HR + SPLIT;
        }

        public static String[] getRoles(String roles){
            if(null == roles){
                return null;
            }
            return roles.split(UserInfo.SPLIT);
        }

        public static String getStatusName(Integer status){
            if(null == status){
                return null;
            }
            if(USER_STATUS_ACTIVE == status){
                return "正常";
            }else if(USER_STATUS_INVALID == status){
                return "失效";
            }else if(USER_STATUS_UNACTIVE == status){
                return "未激活";
            }else if(USER_STATUS_LOCK == status){
                return "锁定";
            }
            return null;
        }
    }

    /* *
     * @Author yyliu
     * @Description 部门通用信息
     * @Date 9:36 2018/9/17
     **/
    public class DepartmentInfo{

        // 部门根节点-父节点
        public static final int ROOT_SUPER_ID                   = 0;

        public static final int DEFAULT_TRY_ID                  = 1;
    }

    public class SubcompanyInfo{
        public static final String DEFAULT_TRY_CODE             = "JCL0000001";
    }
    /* *
     * @Author yyliu
     * @Description 返回编码
     * @Date 9:36 2018/9/17
     **/
    public class ReturnInfo{

        public static final String SUCCESS_CODE                      = "SUC-200-10001";
        public static final String SUCCESS_CODE_LOGIN                = "SUC-200-10002";
        public static final String SUCCESS_CODE_REGISTER             = "SUC-200-10002";

        public static final String WARNING_CODE_REGISTER             = "WARN-300-10022";

        public static final String SUCCESS_MSG                       = "操作成功!";
        public static final String SUCCESS_LOGIN_MSG                 = "登录成功!";
        public static final String ERROR_MSG                         = "操作失败!";
        public static final String ERROR_PARAM_NULL_MSG              = "参数不能为空!";
        public static final String ERROR_PARAM_UNAUTHORIZED_MSG      = "请求参数不合法！";

    }

    public class ResumeExternalInfo{

        public static final int TYPE_RESUME = 0;
        public static final int TYPE_SEARCH_RESUME = 1;
    }
    public class VerificationInfo{

        // 邮箱注册验证码
        public static final int VERIFY_TYPE_EMAIL_REGISTER           = 1;

        // 手机注册验证码
        public static final int VERIFY_TYPE_PHONE_REGISTER           = 2;

        // 邮箱注册验证码失效时间
        public static final int VERIFY_ABATE_EMAIL_MINUTE            = 30;

        // 手机注册验证码失效时间
        public static final int VERIFY_ABATE_PHONE_MINUTE            = 10;

    }

}
